package com.ganmiao.server.sys.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ganmiao.entity.BaseColumns;
import com.ganmiao.server.sys.validated.Add;
import com.ganmiao.server.sys.validated.Delete;
import com.ganmiao.server.sys.validated.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 角色信息
 *
 * @TableName sys_role
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("角色信息")
public class SysRoleDto {

    /**
     * 角色主键ID
     */
    @NotNull(groups = {Update.class, Delete.class}, message = "角色主键ID不能为空")
    @ApiModelProperty("角色主键ID")
    private Integer roleId;

    /**
     * 角色名称
     */
    @NotBlank(groups = {Add.class, Update.class}, message = "角色名称不能为空")
    @ApiModelProperty("角色名称")
    private String roleName;

    /**
     * 显示顺序
     */
    @NotNull(groups = {Add.class, Update.class}, message = "显示顺序不能为空")
    @ApiModelProperty("显示顺序")
    private Integer roleSort;

    /**
     * 系统编码 (supplier:供应商 purchase:采购 portal:门户 mall:商城)
     */
    @ApiModelProperty("系统编码 (supplier:供应商 purchase:采购 portal:门户 mall:商城)")
    private String sysCode;

    /**
     * 供应商ID
     */
    @ApiModelProperty("供应商ID")
    private Integer supplierId;

    /**
     * 商超ID
     */
    @ApiModelProperty("商超ID")
    private Integer shopId;

    /**
     * 状态 (1:正常 3:停用 9:删除/失效)
     */
    @NotBlank(groups = {Delete.class}, message = "状态不能为空")
    @ApiModelProperty("状态 (1:正常 3:停用 9:删除/失效)")
    private String status;

    /**
     * 菜单ID
     */
    @NotEmpty(groups = {Add.class, Update.class}, message = "菜单ID不能为空")
    @ApiModelProperty("菜单ID")
    private Map<String, List<Integer>> menuIdList;

}